<?php

/**
 * @author shuang
 * @date 2016-12-24 19:32:12
 */
use backend\assets\HighchartAsset;
use yii\helpers\Json;

HighchartAsset::register($this);
?>
<?php $this->beginBlock('statuser'); ?>
$('#container').highcharts({
chart: {
type: 'line'
},
title: {
text: '会员注册统计图'
},
subtitle: {
text: ''
},
xAxis: {
categories:<?php echo Json::encode(array_keys($date)); ?>
},
yAxis: {
title: {
text: '人数'
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
credits:{
text:"toupiao518.com"
},
series: [{
name: '注册日期',
data: <?php echo Json::encode(array_keys($nums)); ?>
}]
});
jeDate({
dateCell: '#begin_at',
format: 'YYYY-MM-DD',
festival: true,
maxDate: '2099-06-16 23:59:59', //最大日期
isTime: true
});
jeDate({
dateCell: '#end_at',
format: 'YYYY-MM-DD',
festival: true,
maxDate: '2099-06-16 23:59:59', //最大日期
isTime: true
});
<?php $this->endBlock() ?>  
<?php $this->registerJs($this->blocks['statuser'], \yii\web\View::POS_END); ?>
<div class="formbody">
    <div class="formtitle"><span>统计注册会员图表</span></div>
    <div class="toolsli">
        <form class="pull-left form-search-section" action="" method="get">
            <div class="form-group pull-left">
                <div class="pull-left" style="margin-right: 10px;">
                    <input id="begin_at" class="form-control" name="begin_at"  value="<?php echo $begin_at ? $begin_at :  date('Y-m-d',time()) ;?>"  placeholder="开始日期" autocomplete="off" type="text" />
                </div>
                <div class="pull-left">
                    <input id="end_at" class="form-control" name="end_at" autocomplete="off" type="text" value="<?php echo $end_at ? $end_at : date('Y-m-d',time()) ;?>" placeholder="结束日期"/>
                </div>
            </div>
            <div class="form-btns pull-left">
                <button type="submit" class="btn btn-primary">查 询</button>
            </div>
            <div class="clearfix"></div>
        </form>
    </div>
</div>
<div id="container" style="min-width:400px;height:400px;"></div>